package com.spring.springLearn.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
//声明这是一个切面Bean
@Aspect
public class LogUser {
	@Pointcut("execution(* com.spring..*.hello(..))")
	public void aspectTest(){}
	@Before( "aspectTest()")
	public void before(JoinPoint pj){

		System.out.println("**************before");
		System.out.println("**************before");
	}
	
	@After("aspectTest()")
	public void after(JoinPoint joinPoint){
		System.out.println("**************after");
	}
}
